



        var scrollNew = 0;
        var scrollOld = 0;
        var scrollStep = 20;
        var canScroll;
        var watchScroll = null;
        var scrollIntvl = null;
        //禁止滚动
        window.addEventListener('DOMMouseScroll', function (e) {
            if(window.innerWidth > 1024){
                if(e.detail > 0){//向下滚动
                    console.log('//向下滚动');
                    scrollDown = true;
                }else{//向上滚动
                    console.log('//向上滚动');
                    scrollDown = false;
                }
                custmzScroll();
                
            }
        })
        window.addEventListener('mousewheel', function (e) {
            if(window.innerWidth > 1024){
                if(e.wheelDelta < 0){//向下滚动
                    scrollDown = true;
                }else{//向上滚动
                    scrollDown = false;
                }
                custmzScroll();
            }
        })

        
        function custmzScroll(){
            bodyW = $('main .history')[0].offsetHeight;
            if(scrollDown){
                scrollNew -= 111;
                Math.abs(scrollNew) > canScroll && (scrollNew = -canScroll);
            }else{
                scrollNew += 111;
                scrollNew > 0 && (scrollNew = 0);
            }
            
            scrollStart = true;
        }

        function updateScroll(val){
            $('main .history')[0].left = Math.abs(val);
            $('main .history')[0].style.transform = 'translateX(' + val + 'px)'
        }

        function transformTwice(ele,val,cssName){
            var eleProcess;
            if(ele[0].process == undefined){
                for(var p = 0;p < ele.parents().length;p++){
                    if(ele.parents()[p].process != undefined){
                        eleProcess = ele.parents()[p].process;
                        break;
                    }
                }
            }else{
                eleProcess = ele[0].process;
            }
            ele[0].style.transform = cssName + '(' + (val + (-val * 2 * eleProcess)) + 'px)';
        }

        function scrollProcess(){
            for(var e = 0;e < $('.scrollItem').length;e++){
                var windowLft = $('.scrollItem')[e].getBoundingClientRect().left;
                var itemWidth = $('.scrollItem')[e].offsetWidth;
                var widnowWidth = window.innerWidth;
                if($('.scrollItem')[e].scrollStop == "overself" && $('.scrollItem')[e].scrollStart == 'former'){
                    if(windowLft > widnowWidth){
                        $('.scrollItem')[e].process = 0;
                    }else if(windowLft <= widnowWidth && windowLft > -itemWidth){
                        $('.scrollItem')[e].process = (widnowWidth - windowLft) / (itemWidth + widnowWidth);
                    }else if(windowLft <= -itemWidth){
                        $('.scrollItem')[e].process = 1;
                    }
                }else if($('.scrollItem')[e].scrollStop.indexOf('%') >= 0 && $('.scrollItem')[e].scrollStart.indexOf('%') >= 0){
                    var scrollStop = parseFloat($('.scrollItem')[e].scrollStop);
                    var scrollStart = parseFloat($('.scrollItem')[e].scrollStart);
                    if(windowTop > scrollStart * widnowHeight / 100){
                        $('.scrollItem')[e].process = 0;
                    }else if(windowTop <= scrollStart * widnowHeight / 100 && windowTop >= scrollStop * widnowHeight / 100){
                        $('.scrollItem')[e].process = (scrollStart * widnowHeight / 100 - windowTop) / ((scrollStart - scrollStop) * widnowHeight / 100);
                    }else{
                        $('.scrollItem')[e].process = 1;
                    }
                }
            }
            exclusiveActions();
        }
        
        var exclsvList = [
            {el:'main .history .itm1 .num1.vc',styleName:'translate(',list:[{start:48,stop:68},{start:80,stop:120},{start:80,stop:120}]},
            {el:'main .history .itm1 .num2',styleName:'translateX(',list:[{start:0,stop:236},{start:-10,stop:230},{start:-10,stop:230}]},
            {el:'main .history .itm2 .num1',styleName:'translateX(',list:[{start:2,stop:378},{start:-8,stop:542},{start:-2,stop:370}]},
            {el:'main .history .itm2 .num2',styleName:'translateX(',list:[{start:57,stop:417},{start:66,stop:419},{start:48,stop:336}]},
            {el:'main .history .itm2 .pic1',styleName:'translateX(',list:[{start:72,stop:174},{start:93,stop:185},{start:50,stop:100}]},
            {el:'main .history .itm2 .pic2',styleName:'translateX(',list:[{start:0,stop:99},{start:0,stop:100},{start:0,stop:100}]},
            {el:'main .history .itm2 .pic3',styleName:'translateX(',list:[{start:146,stop:281},{start:131,stop:257},{start:106,stop:212}]},
            {el:'main .history .itm2 .pic4',styleName:'translateX(',list:[{start:177,stop:454},{start:118,stop:370},{start:93,stop:296}]},
            {el:'main .history .itm2 .border',styleName:'translateX(',list:[{start:184,stop:470},{start:155,stop:380},{start:132,stop:316}]},
            {el:'main .history .itm3 .pic1',styleName:'translateX(',list:[{start:20,stop:168},{start:8,stop:524},{start:2,stop:547}]},
            {el:'main .history .itm3 .pic2',styleName:'translateX(',list:[{start:7,stop:155},{start:33,stop:289},{start:36,stop:329}]},
            {el:'main .history .itm3 .border',styleName:'translateX(',list:[{start:5,stop:383},{start:2,stop:443},{start:40,stop:340}]},
            {el:'main .history .itm3 .year',styleName:'translateX(',list:[{start:67,stop:168},{start:35,stop:292},{start:350,stop:850}]},
            {el:'main .history .itm3 .pic3.vc',styleName:'translate(',list:[{start:13,stop:315},{start:5,stop:260},{start:12,stop:259}]},
            {el:'main .history .itm3 .num1',styleName:'translateX(',list:[{start:10,stop:272},{start:8,stop:234},{start:7,stop:217}]},
            {el:'main .history .itm3 .num2',styleName:'translateX(',list:[{start:6,stop:663},{start:8,stop:604},{start:4,stop:549}]},
            {el:'main .history .itm3 .num3',styleName:'translateX(',list:[{start:10,stop:236},{start:10,stop:244},{start:14,stop:248}]},
            {el:'main .history .itm3 .num4',styleName:'translateX(',list:[{start:3,stop:555},{start:10,stop:522},{start:-8,stop:505}]},
            {el:'main .history .itm4 .year',styleName:'translateX(',list:[{start:-182,stop:1050},{start:-127,stop:950},{start:-101,stop:801}]},
        ]

        function exclusiveActions(){
            var valInd;
            if(window.innerWidth > 1600){
                valInd = 0;
            }else if(window.innerWidth > 1365 & window.innerWidth <= 1600){
                valInd = 1;
            }else{
                valInd = 2;
            }
            exclsvList.forEach(function(item,i){
                var styleTxt = item.styleName + (item.list[valInd].start - $(item.el)[0].process * item.list[valInd].stop);
                if(item.el.indexOf('vc') >= 0){
                    styleTxt += 'px,-50%)';
                }else{
                    styleTxt += 'px)';
                }
                $(item.el)[0].style.transform = styleTxt;
            })
            
            
        }

        $(document).ready(function(){
            $('main .history')[0].left = 0; 
            watchScroll = setInterval(function(){
                var bodyW = $('main .history')[0].offsetWidth;
                canScroll = parseInt(bodyW - window.innerWidth);
                var scrollX = $('main .history')[0].left;
                $('main .timeLine .ing').width(((scrollX / canScroll).toFixed(4) * 100) + '%');
            },10)
    
            scrollIntvl = setInterval(function(){
                var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
                if($('.normal').length && scrollTop){
                    $('footer').addClass('active');
                }else{
                    $('footer').removeClass('active');
                }
                if(window.innerWidth <= 1024 && !$('.normal').length){
                    $('body').addClass('normal');
                }else if(window.innerWidth > 1024 && $('.normal').length && !$('.mobileDevice').length){
                    $('body').removeClass('normal');
                }
                if(!scrollStart || $('.nomal').length) return false;
                if(scrollNew > scrollOld){
                    scrollOld += Math.ceil((scrollNew - scrollOld) / scrollStep);
                }else{
                    scrollOld -= Math.ceil((scrollOld - scrollNew) / scrollStep);
                }
                updateScroll(scrollOld);
                scrollProcess();
            },10)

            for(var s = 0;s < $('.scrollItem').length;s++){
                $('.scrollItem')[s].scrollStart = $('.scrollItem:eq(' + s + ')').attr('scroll-start');
                $('.scrollItem')[s].scrollStop = $('.scrollItem:eq(' + s + ')').attr('scroll-stop');
            }
            scrollProcess();

        })